public class Car {
    private String brand;
    private String model;
    private int year;
    private double engineSize;
    private int mileage;

    public Car(String brand, String model, int year) {
        this.brand = brand;
        this.model = model;
        this.year = year;
        this.engineSize = 1.8;
        this.mileage = 0;
    }

    public Car(String brand, String model, int year, double engineSize, int mileage) {
        this.brand = brand;
        this.model = model;
        this.year = year;
        this.engineSize = engineSize;
        this.mileage = mileage;
    }

    public void drive(int distance) {
        System.out.println("Driving " + distance + " kilometers.");
        this.mileage += distance;
    }

    public void printSpecs() {
        System.out.println(brand + " " + model + " (" + year + ")");
        System.out.println("Engine size: " + engineSize);
        System.out.println("Mileage: " + mileage);
    }

    public double getEngineSize() {
        return engineSize;
    }

    public static void main(String[] args) {
        Car car1 = new Car("Toyota", "Corolla", 2018);
        Car car2 = new Car("Honda", "Civic", 2020, 2.0, 5000);

        car1.printSpecs();
        car1.drive(100);
        System.out.println("Engine size of car2: " + car2.getEngineSize());

        Person person1 = new Person("John", 30, "Software Engineer");
        Person person2 = new Person("Mary", 25, "Doctor", "Female", "123 Main St.");

        person1.introduce();
        person1.setAddress("456 Oak Ave.");
        System.out.println("Person2's address: " + person2.getAddress());
    }
}


